#include "state.h"
#include "state_stack.h"

using namespace krryn::core;

state::state(const std::string &a_Name) : m_States(state_stack::get_instance()) {
	// subsribe to the state_stack
	state_stack::get_instance().subscribe(a_Name, const_cast<state*>(this));
	m_IsInit = false;
}

void state::start(){
	if(!m_IsInit){
		init();
		m_IsInit = true;
	}

	activate();
}

void state::stop(){
	deactivate();
}
